//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __TFSSYS_H_
#define __TFSSYS_H_
#include <ddk.h>

// driver and other OS relative objects and operations

typedef IDeviceDriver DevDriver;
typedef DevDriver* PDevDriver;
typedef DevDriver** PPDevDriver;

#define FTLControl_DeleteBlock 0x10000001

EXTERN_C Boolean GetDevDriver(
                /*[in]*/const wchar_t * pDevName,
                /*[out]*/PPDevDriver ppDev);

EXTERN_C ECode ReadDevice(
                /*[in]*/const PDevDriver pDevDriver,
                /*[in]*/UInt64 u64Offset,
                /*[in]*/UInt32 uNumberOfBytesToRead,
                /*[out]*/PByte pBuffer,
                /*[out]*/UInt32 *pReadSize,
                /*[out]*/PVoid *pExtArg);

EXTERN_C ECode WriteDevice(
                /*[in]*/const PDevDriver pDevDriver,
                /*[in]*/Int64 u64Offset,
                /*[in]*/ UInt32 uSizeToWrite,
                /*[in]*/const PByte pBuffer,
                /*[out]*/Int32 *pSizeWritten,
                /*[out]*/PVoid *pExtArg);

EXTERN_C ECode DeleteBlock(
                /*[in]*/const PDevDriver pDevDriver,
                /*[in]*/UInt32 sector,
                /*[in]*/UInt32 nblocks);

#endif //__TFSSYS_H_
